package com.zhouxiaoge.策略模式;

/**
 * @author 周小哥  gqzmy@163.com 2022/9/27 23:02
 */

public class ApplyDemo {
    public static void main(String[] args) {
        StrategyContext strategyContext;

        System.out.println("----------使用第一个策略----------");
        strategyContext = new StrategyContext(new FirstStrategyImpl());
        strategyContext.operate();

        System.out.println("----------使用第二个策略----------");
        strategyContext = new StrategyContext(new SecondStrategyImpl());
        strategyContext.operate();

        System.out.println("----------使用第三个策略----------");
        strategyContext = new StrategyContext(new ThreeStrategyImpl());
        strategyContext.operate();

    }
}
